package com.aiit.service.impl;

import com.aiit.dao.DoctorDao;
import com.aiit.pojo.Doctor;
import com.aiit.pojo.DoctorbyDept;
import com.aiit.service.IDoctorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class DoctorServiceImpl implements IDoctorService {
    @Resource
    private DoctorDao dao;

    @Override
    public Doctor findDoctor(String loginname, String password) {
        return dao.findDoctor(loginname,password);
    }

    @Override
    public int addDoctor(Doctor doctor) {
        int res=dao.addDoctor(doctor);
        return res;
    }

    @Override
    public List<DoctorbyDept> findAll() {
        return dao.findAll();
    }

    @Override
    public List<DoctorbyDept> findDoctorById(String name, String idnumber) {
        return dao.findDoctorById(name,idnumber);
    }

    @Override
    public int doctorUpdate(Doctor doctor) {
        return dao.doctorUpdate(doctor);
    }

    @Override
    public Doctor selectDoctorById(int userid) {
        return dao.selectDoctorById(userid);
    }
}
